package com.wankuma.hcm.midlet.metwit;
import METwit;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Displayable;

public class Alerter {
	private static Alert _alert = new Alert("");
	
	public static void alert(String str, String title, AlertType type) {
		Displayable d = null;
		if(METwit.getDisplay().getCurrent() == null)
			d = METwit.getMainScreen();
		else
			d = METwit.getDisplay().getCurrent();
		_alert.setString(str);
		_alert.setTitle(title);
		_alert.setType(type);
		METwit.getDisplay().setCurrent(_alert, d);
	}
	
	public static void alert(String str, String title) {
		alert(str, title, AlertType.INFO);
	}
	
	public static void alert(String str) {
		alert(str, "METwit", AlertType.INFO);
	}
	
	public static int getTimeout(){
		return _alert.getTimeout();
	}
	
	public static void setTimeout(int t){
		_alert.setTimeout(t);
	}
}